package com.nyt.org.common.utils;

import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

public class PropKit {

    public final static Map<String,String> map = new HashMap<>();

    public static void getProp(){
        Properties properties1 =PropertiesUtils.getProperties("D:/开发记录/2020-03-03中旅票务服务接口/zhonglv_ticketService/src/main/resources/config.properties");
        //Properties properties1 =PropertiesUtils.getProperties("classpath*:application.properties");
        Enumeration<String> en = (Enumeration<String>) properties1.propertyNames();
        while (en.hasMoreElements()){
            //读取属性名称
            String key = en.nextElement();
            System.out.println("属性名："+key);
            //读取属性值
            String value = properties1.get(key).toString();
            //存到全局map中
            map.put(key,value);
        }
    }

}
